import { AntdModalProps } from '@/hooks/useAntdModal';
import { addCodeupAppLink } from '@/service/deliver';
import { Form, Modal } from 'antd';
import React from 'react';
import AppSelect from './AppSelect';

const AddSubApp = ({ form, modalProps }: AntdModalProps) => {
  const onOk = () => {
    const data = form.getFieldsValue()
    addCodeupAppLink(data)
  }
  return (<Modal title='添加子应用' {...modalProps} onOk={onOk}>
    <Form form={form}>
      <Form.Item hidden name='parentId'/>
      <Form.Item label='应用' name='subId'>
        <AppSelect />
      </Form.Item>
    </Form>
  </Modal>)
}
export default AddSubApp